﻿using HRMSystem.Wpf.EmployeePages;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Windows;

namespace HRMSystem
{
    public class Session
    {
        //(0, "Super Admin")(1, "Company Manager")(2, "Branch Manager")(3, "Department Manager")(4, "Employee")(5, "Other")
        public static int AdminState = 5;

        public static int NewEmployeeID = 0;
        public static int CompanyID = 0;
        public static int BranchID = 0;
        public static int DepartmentID = 0;

        public static Employee LoggedEmployee = null;
        private static Employee _selectedEmployee = null;
        public static Object Navigation = null;

        public static Employee SelectedEmployee
        {
            get 
            {
                return _selectedEmployee;             
            }
            set 
            {
                if (value != null)
                {
                    EmployeePage.Instance.SelectedEmployeeName.Content = value.PREFERRED_NAME;
                    EmployeePage.Instance.SelectedEmpLogOutButton.Visibility = Visibility.Visible;

                    if (Navigation != null)
                        EmployeePage.Instance.ContentFrame.Content = Navigation;
                    else EmployeePage.Instance.ContentFrame.Content = EditProfilePage.Instance;
                }
                _selectedEmployee = value;
            }
        }

        public static void LogOutSelectedEmployee()
        {
            EmployeePage.Instance.SelectedEmployeeName.Content = "No Employee Selected";
            EmployeePage.Instance.SelectedEmpLogOutButton.Visibility = Visibility.Hidden;
            EmployeePage.Instance.ContentFrame.Content = QuickSearchPage.Instance;

            SelectedEmployee = null; ;
        }
    }
}
